package com.glls.sbdemo6.controller;

import com.glls.sbdemo6.pojo.User;
import io.swagger.annotations.*;
import org.springframework.web.bind.annotation.*;

/**
 * @date 2023/5/11
 * @desc
 */
@RestController
@RequestMapping("/user")
@Api(value = "用户模块 在线接口文档",tags = "用户模块 在线接口文档222")
public class UserController {

    @GetMapping("/{id}")
    @ApiOperation(value = "根据用户唯一标识获取用户信息")
    @ApiImplicitParams({@ApiImplicitParam(name = "id",value = "用户id",defaultValue = "0")})
    public User findById(@PathVariable @ApiParam(value = "用户唯一标识") Integer id){

        User user = new User();
        user.setId(id);
        user.setName("zs");

        return user;
    }


    @PostMapping("/add")
    @ApiOperation(value = "添加用户信息")
    public User add(@RequestBody @ApiParam(value = "用户实体参数") User user){

        return user;
    }

}
